<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp" %>

<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%@ include file="../common/btjs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增纸单政策</title>
		<link rel="stylesheet" href="${ctx}/static/lib/bootstrap/3.3.5/css/bootstrap-theme.min.css" />
		<link rel="stylesheet" href="${ctx}/static/lib/bootstrap/3.3.5/css/bootstrap.css" />
		
				

	
</head>
<body>
		<div id="top" class="container-fluid">
			<div style="margin: 30px;">
				<font size="5">
					<p>新增纸单政策</font>
			</div>
			
			<div id = "" class="col-md-12 column">
                <div id="choose">
				  <span style="margin:30px">
					<input name="flighttype" type="radio" value="oneWay" onclick="onway()"/>单程
				  </span>
				  <span style="margin:30px">
				    <input name="flighttype" type="radio" value="roundTrip" onclick="aroundtrip()" checked="checked"/>往返
				  </span>
				</div>
			</div>
			<div style="margin-left: 30px;margin-top: 50px;" id = "line_info" class="col-md-12 column">
				<div><font size="4"><p>运价路由信息</font></div>
					<div>
						<form name="line_info">
						<div>
							
							<table class="table table-hover" style="width: 100%;margin-top: 30px;">
							<tbody>
								<tr>
									<td><font color="red">*</font><span>IPCC:</span></td>
									<td><input type = "text" name = "ipcc" id = "ipcc">&nbsp;&nbsp;<font color="gainsboro">1FMH</font></td>
									<td><font color="red">*</font><span>航空公司:</span></td>
									<td><input type="text" name = "hkcode" id = "hkcode">&nbsp;&nbsp;<font color="gainsboro">航司两字码</font></td>
								</tr>
								<tr>
									<td><font color="red">*</font><span>出发地：</span></td>
									<td><input type="text" name = "fromcity" id = "fromcity">&nbsp;&nbsp;<font color="gainsboro">城市或机场三字码</font></td>
									<td><font color="red">*</font><span>目的地：</span></td>
									<td><input type="text" name = "tocity" id = "tocity">&nbsp;&nbsp;<font color="gainsboro">城市或机场三字码</font></td>
								</tr>
								<tr>
									<td><font color="red">*</font><span>航路：</span></td>
									<td><input type="text" name = "airline" id = "airline">
										&nbsp;&nbsp;<font color="gainsboro">需完整航路，如：HKG-CTU-HIC-CTU-HKG</font></td>
									<td><font color="red">*</font><span>舱位:</span></td>
									<td><input type="text" name = "cabin" id = "cabin">&nbsp;&nbsp;<font color="gainsboro">每一个航段对应一个舱位，用“,”隔开</font></td>
								</tr>
							</tbody>
							</table>
							<div>
									<font color="red">*</font>
									<span>适用航班：</span>
										<span> 
										<select id="apply_flight" name="suittype">
											<option value="0">全部适用</option>
											<option value="1" >仅限于</option>
											<option value="2">不适用 </option>
										</select>
										</span>
								</div>
							</form>
						</div>
					</div>
			</div>
			<!--
            	作者：fygang0424@163.com
            	时间：2016-04-15
            	描述：运价限制
            -->
            <div style="margin-left: 30px;margin-top: 50px;" class="col-md-12 column" id="condition">
            	<div><font size="4"><p>运价限制</font></div>
            	<form name="condition">
            		<div style="margin-top: 30px;">
            			<div>
            				<span>
            				    <span>去程旅行日期：</span>
            				    <span><input type="text" id="godate_s1">-<input type="text" id="godate_e1"></span>
            				    <button  id="addtime_go1" value ="">增加</button>
            				</span>
            				<span style="margin-left: 30px;">
            					<span>去程除外旅行日期：</span>
            					<span><input type="text" id="goexdate_s1">-<input type="text" name="goexdate_e1"></span>
            					<button  id="addextime_go1" value ="">增加</button>
            				</span>
            			</div>
            			<div id="back_date" style="margin-top: 50px;">
            				<span>
            					<span>回程旅行日期：</span>
            					<span><input type="text" id="backdate_s1">-<input type="text" id="backdate_e1"></span>
            				    <button  id="addtime_back1" value ="">增加</button>
            				</span>
            				<span style="margin-left:30px;">
            					<span>回程除外旅行日期：</span>
            					<span><input type="text" id="backexdate_s1">-<input type="text" name="backexdate_e1"></span>
            				    <button  id="addextime_back1" value ="">增加</button>
            				</span>
            			</div>   
            			
            	
            	</div>
            	<div style="margin-top: 50px;">
            	 <table class="table table-hover" style="width: 100%;margin-top: 30px;">
            		<tbody>
            				<tr id="banqi">
            				
	            				 <td><span>去程班期：</span></td>
	            				 <td> <input type="text" id="goflightdate">&nbsp;&nbsp;<font color="gainsboro">多个班期用","隔开，如：1,3,5</font></td>
	            				 <span id="back_banqi"><td><span>回程班期：</span><td>
	            				 <td><input type="text" id ="backflightdate"></td></span>
            			
            				</tr>
            				<tr id="staytime">
            				 <td><span>最短停留期：</span></td>
            				 <td> <input type="text" id="mintime">&nbsp;&nbsp;<font color="gainsboro">1D表示1天，1M表示1个月</font></td>
            				 <td><span>最长停留期：</span><td>
            				 <td><input type="text" id ="maxtime"></td>
            				</tr>
            				<tr>
            				 <td><span>最小出行人数：</span></td>
            				 <td> <input type="text" id="minpeople"></td>
            				 <td><span>最大出行人数：</span><td>
            				 <td><input type="text" id ="maxpeople"></td>
            				</tr>
            				<tr>
            				 <td><span>销售日期：</span></td>
            				 <td> <input type="text" id="saledate_s">-<input type="text" id="saledate_e"></td>
            				 <td><span>出票时限：</span><td>
            				 <td><input type="text" id ="limtime">&nbsp;&nbsp;<font color="gainsboro">填入数字，表示需起飞前X天出票</font></td>
            				</tr>
            		</tbody>
            	 </table>
            	  <div>
            		<span>适用乘客国籍：</span>
            	    <span><select id="apply_citizen">
					<option value="0">全部适用</option>
					<option value="1" >仅限于</option>
					<option value="2">不适用 </option>
					</select></span>
            	  </div>
            	</div>
            </form>
            </div>
            <!--
            	作者：fygang0424@163.com
            	时间：2016-04-15
            	描述：运价价格信息
            -->
            <div style="margin-left: 30px;margin-top: 20px;" class="col-md-12 column" id="priceinfo">
            	<div><font size="4"><p>运价价格信息</font></div>
            	<form name="priceinfo">
            	<table class="table table-hover" style="width: 100%;margin-top: 30px;">
            		<tbody>
            			<tr>
            				<td>
            					票价基础：
            				</td>
            				<td>
            					<input id="baseprice" type="text">
            				</td>
            				<td>
            					销售票面价：
            				</td>
            				<td>
            					<select id= "price_currency">
            						<option value="CNY">CNY</option>
            						<option value="HKD">HKD</option>
            						<option value="USD">USD</option>
            						<option value="GBP">GBP</option>
            						<option value="CAD">CAD</option>
            						<option value="AUD">AUD</option>
            						<option value="SGD">SGD</option>
            						<option value="EUR">EUR</option>
            						<option value="TWD">TWD</option>
            						<option value="THB">THB</option>
            						<option value="RUB">RUB</option>
            					</select>
            					<input type="text" id= "saleprice">
            				</td>
            			</tr>
            		</tbody>
            	</table>
            	</form>
            	<div style="margin:50px"><font color="red">*</font>税费信息由系统从GDS中自动获取</div>
             </div>
             
             
             
             
             
             
             <!--
             	作者：fygang0424@163.com
             	时间：2016-04-15
             	描述：退改签信息
             -->
             <div style="margin-left: 30px;margin-top: 50px;" class="col-md-12 column" id="refund">
             	<div><font size="4"><p>退改签信息信息</font></div>
             	 <form name="refund">
             		<div style="margin-top: 50px;">
             			 <div style="margin: 30px;">
             			 		<div>
             			 			<span>去程可否更改：</span>
             			 			<span><select id="gochange" style="width:100px;" onchange="go_change()">
             			 				<option value="0">否</option>
             			 				<option value="1">是</option>
             			 			</select>
             			 			</span>
             			 			<span style="margin-left: 450px;">回程可否更改：</span>
             			 			<span><select id="backchange" style="width:100px" onchange="back_change()">
             			 				<option value="0">否</option>
             			 				<option value="1">是</option>
             			 			</select>
             			 		    </span>
             			 		</div>
             			 		<div style="margin-top: 10px;">
             			 				<span>去程改期费用：</span>
             			 				<span>
            					        <select id= "go_change_currency" disabled="true">
            						    <option value="CNY">CNY</option>
            						    <option value="HKD">HKD</option>
            						    <option value="USD">USD</option>
            						    <option value="GBP">GBP</option>
            						    <option value="CAD">CAD</option>
            						    <option value="AUD">AUD</option>
            						    <option value="SGD">SGD</option>
            						    <option value="EUR">EUR</option>
            						    <option value="TWD">TWD</option>
            						    <option value="THB">THB</option>
            						    <option value="RUB">RUB</option>
            					        </select>
            					       <input type="text" id= "go_changeprice" readonly="readonly">
            				           </span>
            				        <span style="margin-left: 315px;">回程改期费用：</span>
             			 	 		<span>
            					     <select id= "back_change_currency" disabled="true">
            						 <option value="CNY">CNY</option>
            						 <option value="HKD">HKD</option>
            						 <option value="USD">USD</option>
            						 <option value="GBP">GBP</option>
            						 <option value="CAD">CAD</option>
            						 <option value="AUD">AUD</option>
            						 <option value="SGD">SGD</option>
            						 <option value="EUR">EUR</option>
            						 <option value="TWD">TWD</option>
            						 <option value="THB">THB</option>
            						 <option value="RUB">RUB</option>
            					     </select>
            					     <input type="text" id= "back_changeprice" readonly="readonly">
            				       </span>
             			 		</div>
             			 	</div>
             			</div>
             			
             			
             			<div style="margin-top: 60px;">
             			 		<div style="margin: 30px;">
             			 			<div>
             			 			<span>全部未使用可否退票：</span>
             			 			<span><select id="no_refund" style="width:100px" onchange="allrefund()">
             			 				<option value="0">否</option>
             			 				<option value="1">是</option>
             			 			</select>
             			 			</span>
             			 			<span style="margin-left: 380px ;">部分未使用可否退票：</span>
             			 			<span><select id="part_refund" style="width:100px" onchange="partrefund()">
             			 				<option value="0">否</option>
             			 				<option value="1">是</option>
             			 			</select>
             			 			</span>
             			 			</div>
             			 			<div style="margin-top: 10px;">
             			 				<span>全部未使用退票费用：</span>
             			 				<span>
            					        <select id= "no_refund_currency" disabled="true">
            						    <option value="CNY">CNY</option>
            						    <option value="HKD">HKD</option>
            						    <option value="USD">USD</option>
            						    <option value="GBP">GBP</option>
            						    <option value="CAD">CAD</option>
            						    <option value="AUD">AUD</option>
            						    <option value="SGD">SGD</option>
            						    <option value="EUR">EUR</option>
            						    <option value="TWD">TWD</option>
            						    <option value="THB">THB</option>
            						    <option value="RUB">RUB</option>
            					        </select>
            					       <input type="text" id= "no_refundfee" readonly="readonly">
            				            </span>
            				        <span style="margin-left: 240px;">部分未使用退票金额：</span>
             			 	 		<span>
            					     <select id= "part_refund_currency" disabled="true">
            						 <option value="CNY">CNY</option>
            						 <option value="HKD">HKD</option>
            						 <option value="USD">USD</option>
            						 <option value="GBP">GBP</option>
            						 <option value="CAD">CAD</option>
            						 <option value="AUD">AUD</option>
            						 <option value="SGD">SGD</option>
            						 <option value="EUR">EUR</option>
            						 <option value="TWD">TWD</option>
            						 <option value="THB">THB</option>
            						 <option value="RUB">RUB</option>
            					     </select>
            					     <input type="text" id= "part_refundfee" readonly="readonly">
            				       </span>
             			 	</div>
             			 </div>
             			 	
             			</div>
             			
             			
             			
             			<div style="margin-top: 60px;">
             				<div style="margin: 30px;">
             				
             						<div>
             							<span>是否允许NOSHOW改期：</span>
             							<span>
             								<select id="noshow_changetype" style="width:100px" onchange="noshowchange()">
             			 				     <option value="0">否</option>
             			 				     <option value="1">是</option>
             			 			        </select>
             			 			   </span>
             			 			   <span style="margin-left: 350px;">是否允许NOSHOW退票：</span>
             			 			   <span>
             								<select id="noshow_refundtype" style="width:100px" onchange="noshowrefund()">
             			 				     <option value="0">否</option>
             			 				     <option value="1">是</option>
             			 			        </select>
             			 			   </span>
             						</div>
             						<div style="margin-top: 10px;">
             							<span style="margin-left: 30px;">NOSHOW改期条件：</span>
             							<span>
             							<input type="text" id="noshow_changecondition" readonly="readonly"></span>
             							<span style="margin-left:300px ;">NOSHOW退票条件：</span>
             							<span>
             							<input type="text" id="noshow_refundcondition" readonly="readonly"></span>
             						</div>
             						<div style="margin-top: 10px;">
             			 			<span>去程NOSHOW改期费用：</span>
             			 			<span>
             			 			<select id="noshow_changecurrency_go" disabled="disabled">
             			 			<option value="CNY">CNY</option>
            						 <option value="HKD">HKD</option>
            						 <option value="USD">USD</option>
            						 <option value="GBP">GBP</option>
            						 <option value="CAD">CAD</option>
            						 <option value="AUD">AUD</option>
            						 <option value="SGD">SGD</option>
            						 <option value="EUR">EUR</option>
            						 <option value="TWD">TWD</option>
            						 <option value="THB">THB</option>
            						 <option value="RUB">RUB</option>
             			 			</select>
             			 			<input type="text" id="noshow_changefee_go" readonly="readonly">
             			 			</span>
             			 			<span style="margin-left: 170px;">NOSHOW全部未使用退票费用：</span>
             			 			<span>
             			 			<select id="noshow_all_noused_refundcurrency" disabled="disabled">
             			 				<option value="CNY">CNY</option>
            						 <option value="HKD">HKD</option>
            						 <option value="USD">USD</option>
            						 <option value="GBP">GBP</option>
            						 <option value="CAD">CAD</option>
            						 <option value="AUD">AUD</option>
            						 <option value="SGD">SGD</option>
            						 <option value="EUR">EUR</option>
            						 <option value="TWD">TWD</option>
            						 <option value="THB">THB</option>
            						 <option value="RUB">RUB</option>
             			 			</select>
             			 			<input type="text" id="noshow_all_noused_refundfee" readonly="readonly">
             			 			</span>
             			 			</div>
             			 			<div style="margin-top: 10px;">
             			 			<span>回程NOSHOW改期费用：</span>
             			 			<span>
             			 			<select id="noshow_changecrrency_back" disabled="disabled">
             			 			<option value="CNY">CNY</option>
            						 <option value="HKD">HKD</option>
            						 <option value="USD">USD</option>
            						 <option value="GBP">GBP</option>
            						 <option value="CAD">CAD</option>
            						 <option value="AUD">AUD</option>
            						 <option value="SGD">SGD</option>
            						 <option value="EUR">EUR</option>
            						 <option value="TWD">TWD</option>
            						 <option value="THB">THB</option>
            						 <option value="RUB">RUB</option>
             			 			</select>
             			 			<input type="text" id="noshow_changefee_back" readonly="readonly">
             			 			</span>
             			 			<span style="margin-left: 170px;">NOSHOW部分未使用退票费用：</span>
             			 			<span>
             			 			  <select id="noshow_part_noused_refundcurrency" disabled="disabled">
             			 				<option value="CNY">CNY</option>
            						 <option value="HKD">HKD</option>
            						 <option value="USD">USD</option>
            						 <option value="GBP">GBP</option>
            						 <option value="CAD">CAD</option>
            						 <option value="AUD">AUD</option>
            						 <option value="SGD">SGD</option>
            						 <option value="EUR">EUR</option>
            						 <option value="TWD">TWD</option>
            						 <option value="THB">THB</option>
            						 <option value="RUB">RUB</option>
             			 			</select>
             			 			<input type="text" id="noshow_part_noused_refundfee" readonly="readonly">
             			 			</span>
             			 			</div>
             			 	</div>
             			</div>
             		</form>
             </div>
             <div style="margin-top:50px ;"><span style="margin-left:1000px ;"> <input  type="button" value="确认提交"   id="submitInfo"/></span></div>

		</div>
	</body>
	
 

	
<script type="text/javascript">

function onway(){
	$('#back_date').hide();
	$('#staytime').hide();
}

function aroundtrip(){
	$('#back_date').show();
	$('#staytime').show();
}

function addtime_go(){
	
}

function go_change(){
	var option = $('#gochange').val();
	if(option == '1'){
		$('#go_change_currency').removeAttr("disabled");
		$('#go_changeprice').removeAttr("readonly");
	}
	else{
		$('#go_change_currency').attr("disabled","true");
		$('#go_changeprice').attr("readonly","readonly");
	}
}

function back_change(){
	var option = $('#backchange').val();
	if(option == '1'){
		$('#back_change_currency').removeAttr("disabled");
		$('#back_changeprice').removeAttr("readonly");
	}
	else{
		$('#back_change_currency').attr("disabled","true");
		$('#back_changeprice').attr("readonly","readonly");
	}
}

function allrefund(){
	var option = $('#no_refund').val();
	if(option == '1'){
		$('#no_refund_currency').removeAttr("disabled");
		$('#no_refundfee').removeAttr("readonly");
	}
	else{
		$('#no_refund_currency').attr("disabled","true");
		$('#no_refundfee').attr("readonly","readonly");
	}
}

function partrefund(){
	var option = $('#part_refund').val();
	if(option == '1'){
		$('#part_refund_currency').removeAttr("disabled");
		$('#part_refundfee').removeAttr("readonly");
	}
	else{
		$('#part_refund_currency').attr("disabled","true");
		$('#part_refundfee').attr("readonly","readonly");
	}
}
function noshowchange(){
	var option = $('#noshow_changetype').val();
	if(option == '1'){
		$('#noshow_changecurrency_go').removeAttr("disabled");
		$('#noshow_changecrrency_back').removeAttr("disabled");
		$('#noshow_changecondition').removeAttr("readonly");
		$('#noshow_changefee_go').removeAttr("readonly");
		$('#noshow_changefee_back').removeAttr("readonly");
	}
	else{
		$('#noshow_changecurrency_go').attr("disabled","true");
		$('#noshow_changecrrency_back').attr("disabled","true");
		$('#noshow_changecondition').attr("readonly","readonly");
		$('#noshow_changefee_go').attr("readonly","readonly");
		$('#noshow_changefee_back').attr("readonly","readonly");
	}
}

function noshowrefund(){
	var option = $('#noshow_refundtype').val();
	if(option == '1'){
		$('#noshow_all_noused_refundcurrency').removeAttr("disabled");
		$('#noshow_part_noused_refundcurrency').removeAttr("disabled");
		$('#noshow_refundcondition').removeAttr("readonly");
		$('#noshow_all_noused_refundfee').removeAttr("readonly");
		$('#noshow_part_noused_refundfee').removeAttr("readonly");
	}
	else{
		$('#noshow_all_noused_refundcurrency').attr("disabled","true");
		$('#noshow_part_noused_refundcurrency').attr("disabled","true");
		$('#noshow_refundcondition').attr("readonly","readonly");
		$('#noshow_all_noused_refundfee').attr("readonly","readonly");
		$('#noshow_part_noused_refundfee').attr("readonly","readonly");
	}
}




	$(function(){
		var dat;

		$('#submitInfo').click(function(){
			alert("aaaaa");
			 dat = $("form").serialize();
			 alert(dat);
			 console.log(dat);
			 ajaxclick();
		});
		
		
	  function ajaxclick() {
			$.ajax({
              cache: true,
              type: "POST",
              url: "addPaperOrder",
              data:dat,
              async: false,
              error: function(request) {
                  console.log("Connection error");
              },
              success: function(data) {
                 console.log("success");
              }
          });
		}
	  
	  
	  
	  
	 
	});
</script>
	
</html>








